package com.hopu.mybatis.service.impl;

import com.hopu.mybatis.dao.BookMapper;
import com.hopu.mybatis.entity.TbBook;
import com.hopu.mybatis.service.IBookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BookServiceImpl implements IBookService {

    @Autowired
    private BookMapper bookMapper;


    @Override
    public void add(TbBook book) {
        bookMapper.add(book);
    }

    @Override
    public void update(TbBook book) {
        bookMapper.update(book);
    }

    @Override
    public void delete(Long bookId) {
        bookMapper.delete(bookId);
    }

    @Override
    public TbBook selectById(Long id) {
        return bookMapper.selectById(id);
    }

    @Override
    public List<TbBook> selectAll() {
        return bookMapper.selectAll();
    }
}
